<?php
declare (strict_types = 1);

namespace app\api\controller;

use app\BaseController;
use app\common\lib\Show;
use think\facade\Request;
use app\common\business\Goods;

class Index extends BaseController
{
    /**
     * 首页推荐商品
     *
     * @return array
     */
    public function getRotationChart()
    {
        $goods = new Goods();
        $indexRecommend = $goods->getRotationChart();

        return Show::success($indexRecommend);
    }

    /**
     * 首页展示分类商品
     *
     * @return array
     */
    public function cagegoryGoodsRecommend()
    {
        $categoryId = [5];
        $goods      = new Goods();
        $result     = $goods->categoryGoodsRecommend($categoryId);
        return Show::success($result);
    }
}
